package com.xyy.saas.payment.manage.cores.enums;

public enum BusinessIdTypeEnum {
    /**
     * 一块钱医生业务类型
     */
    YIKUAIQIAN_DOC("yikuaiqian_doc", "一块钱医生业务类型"),
    /**
     * 一块钱医生国控业务类型
     */
    YIKUAIQIAN_DOC_GK("yikuaiqian_doc_gk", "一块钱医生国控业务类型"),
    /**
     * 一块钱富民
     */
    YIKUAIQIAN_FM("yikuaiqian_fm", "一块钱富民"),
    /**
     * 一块钱药店业务类型
     */
    YIKUAIQIAN_DRUGSTORE("yikuaiqian_drugstore", "一块钱药店业务类型"),
    /**
     * ec的ka
     */
    EC_KA("ec_ka", "ec的ka"),
    /**
     * ec的order
     */
    EC_ORDER("ec_order", "ec的order"),
    /**
     * 毛竹
     */
    SAAS_CRM("saas_crm", "毛竹"),
    /**
     * 单品交易
     */
    SAAS_TRADE("saas_trade", "单品交易"),
    /**
     * 宜块钱资质认证业务
     */
    YIKUAIQIAN_ATTESTATION("yikuaiqian_attestation", "宜块钱资质认证业务"),
    /**
     * 宜块钱保险业务
     */
    YIKUAIQIAN_INSURANCE("yikuaiqian_insurance", "宜块钱保险业务"),
    /**
     * 宜块钱保险业务
     */
    YIKUAIQIAN_LINGZHI("yikuaiqian_lingzhi", "宜块钱保险业务"),
    /**
     * 智慧脸商城
     */
    SAAS_MALL("saas_mall", "智慧脸商城"),
    /**
     * 药帮忙自营
     */
    EC_SELF_SUPPORT("ec_self_support", "药帮忙自营"),
    /**
     * 药帮忙POP
     */
    EC_POP("ec_pop", "药帮忙POP"),
    /**
     * INS_ORD
     */
    INS_ORD("ins_ord", "INS_ORD"),
    /**
     * HEYE_HMY
     */
    HEYE_HMY("heye_hmy", "HEYE_HMY"),
    /**
     * SAAS_XYK
     */
    SAAS_XYK("saas_xyk", "SAAS_XYK"),
    /**
     * ec_college_virtual
     */
    EC_COLLEGE_VIRTUAL("ec_college_virtual", "ec_college_virtual");
    ;
    private String type;
    private String desc;

    BusinessIdTypeEnum(String type, String desc){
        this.type = type;
        this.desc = desc;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public static String getBusinessType(String businessIdType){
        if(BusinessIdTypeEnum.EC_SELF_SUPPORT.getType().equals(businessIdType)) {
            return BusinessTypeEnum.EC.getType();
        }
        if(YIKUAIQIAN_ATTESTATION.getType().equals(businessIdType)
            ||YIKUAIQIAN_DOC.getType().equals(businessIdType)
            ||YIKUAIQIAN_DOC_GK.getType().equals(businessIdType)
            ||YIKUAIQIAN_DRUGSTORE.getType().equals(businessIdType)
            ||YIKUAIQIAN_FM.getType().equals(businessIdType)
            ||YIKUAIQIAN_INSURANCE.getType().equals(businessIdType)
            ||YIKUAIQIAN_LINGZHI.getType().equals(businessIdType)) {
            return BusinessTypeEnum.YIKUAIQIAN.getType();
        }
        if(SAAS_CRM.getType().equals(businessIdType)
                ||SAAS_MALL.getType().equals(businessIdType)
                ||SAAS_TRADE.getType().equals(businessIdType)
                ||SAAS_XYK.getType().equals(businessIdType)) {
            return BusinessTypeEnum.SAAS.getType();
        }
        if(EC_COLLEGE_VIRTUAL.getType().equals(businessIdType)
                ||EC_KA.getType().equals(businessIdType)
                ||EC_ORDER.getType().equals(businessIdType)
                ||EC_POP.getType().equals(businessIdType)
                ||EC_SELF_SUPPORT.getType().equals(businessIdType)) {
            return BusinessTypeEnum.EC.getType();
        }
        if(INS_ORD.getType().equals(businessIdType)) {
            return BusinessTypeEnum.INS.getType();
        }
        if(HEYE_HMY.getType().equals(businessIdType)) {
            return BusinessTypeEnum.HEYE.getType();
        }
        throw new UnsupportedOperationException("UnsupportedOperationException#getBusinessType, businessIdType=" + businessIdType);
    }
}
